<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>一朵 -- 个人中心</title>
  <!-- swiper-2.7css -->
    <link rel="stylesheet" href="__STATIC__/index/js/swiper/idangerous.swiper.css">
  <!-- swiper-2.7js -->
    <script src="__STATIC__/index/js/swiper/idangerous.swiper.min.js"></script>
  <!-- jquery-3.2.1引用 -->
    <script src="__STATIC__/index/js/global/jquery-3.2.1.min.js"></script>
  <!-- 阿里巴巴矢量图库 -->
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_561814_z72ky81kih08uxr.css">
  <!-- 公共头部 脚部 -->
    <link rel="stylesheet" href="__STATIC__/index/css/global/global.css">
  <!-- 超过1200屏幕 -->
    <link rel="stylesheet" media="screen and (min-width: 1200px)" href="__STATIC__/index/css/my/my1200.css" />
  <!-- 1080-1200 -->
    <link rel="stylesheet" media="screen  and (min-width: 1080px) and (max-width: 1199px) " href="__STATIC__/index/css/my/my1080.css"
    />
  <!-- 960-1080 -->
    <link rel="stylesheet" media="screen  and (min-width: 960px) and (max-width: 1079px) " href="__STATIC__/index/css/my/my960.css" />
  <!-- 768-959 -->
    <link rel="stylesheet" media="screen  and (min-width: 768px) and (max-width: 959px) " href="__STATIC__/index/css/my/my768.css" />
  <!-- 568-767 -->
    <link rel="stylesheet" media="screen  and (min-width: 568px) and (max-width: 767px) " href="__STATIC__/index/css/my/my568.css" />
  <!-- 375-567 -->
    <link rel="stylesheet" media="screen  and (min-width: 375px) and (max-width: 567px) " href="__STATIC__/index/css/my/my375.css" />
  <!-- 小于375-->
    <link rel="stylesheet" media="screen  and (max-width: 374px) " href="__STATIC__/index/css/my/my320.css" />
  <!--一引入layer-->
    <script src="__STATIC__/layer/layer.js"></script>
    <style>
        .pages a,.pages span {
          display:inline-block;
          padding:4px 7px;
          margin:0 2px;
          border:1px solid #D5D4D4;
          -webkit-border-radius:1px;
          -moz-border-radius:1px;
          border-radius:1px;
        }
        .pages a,.pages li {
          display:inline-block;
          list-style: none;
          text-decoration:none; color:#077ee3;
        }
        .pages a:hover{
          border-color:#077ee3;
        }
        .pages span.current{
          background:#077ee3;
          color:#FFF;
          font-weight:700;
          border-color:#077ee3;
        }
        .long-tr th{
          text-align: center
        }
        .long-td td{
          text-align: center
        }
    </style>
</head>

<body>

    <div class="M">
        <div class="m-header">
            <div>
                <span onclick="go_back();">
                    <span class="iconfont icon-xiangzuo" ></span>
                    返回
                </span>
                <span>个人中心</span>
                <span>
                    {if condition="!empty($realname)"}
                        <a href="{:url('User/index')}" class="my" >
                            {$realname}
                        </a>
                    {else /}
                        <a href="{:url('Login/loginin')}">登录</a>
                    {/if}
                    <a href="{:url('MyCart/my_cart')}" class="car">
                        <span class="iconfont icon-gouwuche"></span>
                        <span>{$cart_num}</span>
                    </a>
                </span>
            </div>

        </div>
        <div class="m-my">
            <div>
                <div>
                    <img src="{if condition='!empty($user.logo)'} {$user.logo} {else /} __STATIC__/index/touxiang.png{/if}" alt="">
                </div>
                <div>
                    <p>{$realname}
                        <a href="{:url('User/m_edit_member_info')}">完善信息</a>
                    </p>
                    <p class="bojin" >
                        <img src="{$level_info.logo}" alt="">
                        <a href="{:url('User/quanyi')}"><span>{$level_info.title}</span></a>
                    </p>
                    <p class="pay">
                        <a href="{:url('User/recharge')}">余额：{$user.user_money}</a>
                        <a href="{:url('User/my_point_rank')}">积分：{$user.pay_points}</a>
                    </p>
                </div>
                <div>
                    <a href="{:url('User/my_paycode')}">
                        <p>
                            <i class="iconfont icon-tiaoxingma"></i>
                        </p>
                        <p>支付码</p>
                    </a>
                    <a href="{:url('User/my_invite_qrcode')}">
                        <p>
                            <i class="iconfont icon-erweima"></i>
                        </p>
                        <p>邀请码</p>
                    </a>
                </div>
            </div>
        </div>
        <div class="m-indent">
            <a href="{:url('User/my_order')}">
                <p>
                    <i class="iconfont icon-dingdan"></i>
                </p>
                <p>
                    全部订单
                </p>
            </a>
            <a href="{:url('User/my_order')}?status=0">
                <p>
                    <i class="iconfont icon-qianbao"></i>
                </p>
                <p>
                    待付款
                </p>
            </a>
            <a href="{:url('User/my_order')}?status=1">
                <p>
                    <i class="iconfont icon-daifahuo"></i>
                </p>
                <p>
                    待发货
                </p>
            </a>
            <a href="{:url('User/my_order')}?status=2">
                <p>
                    <i class="iconfont icon-biaoqian-fahuo"></i>
                </p>
                <p>
                    待收货
                </p>
            </a>
            <a href="{:url('User/my_order')}?status=4">
                <p>
                    <i class="iconfont icon-pingjia"></i>
                </p>
                <p>
                    待评价
                </p>
            </a>
        </div>
        <a href="{:url('User/recharge')}" class="m-biaoti">
            <p>
                <span>充值</span>
                <span>获赠会员权益</span>
            </p>
        </a>
        <a href="{:url('User/my_coupon')}" class="m-biaoti">
            <p>
                <span>优惠券</span>
                <span>{$coupon_num}张未使用</span>
            </p>
        </a>
        <a href="{:url('Address/index')}" class="m-biaoti">
            <p>
                <span>收货地址</span>
            </p>
        </a>
        <a href="{:url('User/my_center')}" class="m-biaoti">
            <p>
                <span>安全中心</span>
            </p>
        </a>
        <div class="m-fenxiang">
            <a href="{:url('User/my_point_rank')}">
                <p>
                    <i class="iconfont icon-paihang"></i>
                </p>
                <p>门店排行</p>
            </a>
            <a href="{:url('User/my_collect')}">
                <p>
                    <i class="iconfont icon-shoucang"></i>
                </p>
                <p>我的收藏</p>
            </a>
            <a href="{:url('User/my_invite_qrcode')}">
                <p>
                    <i class="iconfont icon-fenxiang"></i>
                </p>
                <p>分享活动</p>
            </a>
            <a href="tel:{$store.mobile}">
                <p>
                    <i class="iconfont icon-kefu"></i>
                </p>
                <p>联系客服</p>
            </a>
        </div>
    </div>
    <!------------------------ PC ------------------------>

    <div class="PC">
        <!-- 公共头部 -->
        {include file="public/p_header" /}
        <!-- 公共头部结束 -->
        <div class="pc-content">
            <div class="PC_left">
                <div>
                    <img src="{if condition='!empty($user.logo)'} {$user.logo} {else /} __STATIC__/index/touxiang.png{/if}" alt="">
                </div>
                <div>
                    <div>
                        <a href="{:url('User/index')}" class="highlight">全部订单</a>
                    </div>
                    <div>
                        <a href="{:url('User/my_coupon')}">优惠券</a>
                    </div>
                    <div>
                        <a href="{:url('Address/index')}">收货地址</a>
                    </div>
                    <div>
                        <a href="{:url('User/my_center')}">安全中心</a>
                    </div>
                    <div>
                        <a href="{:url('User/my_point_rank')}">积分排行</a>
                    </div>
                    <div>
                        <a href="{:url('User/my_collect')}">我的收藏</a>
                    </div>
                  <!--<div>-->
                  <!--<a href="">分享活动</a>-->
                  <!--</div>-->
                    <div>
                        <a href="{:url('Article/index')}?cate_id=1">联系我们</a>
                    </div>
                </div>

            </div>

            <div class="PC_right">
                <div>
                    <div>
                        <p>{$realname}
                            <span class="my" onclick="edit_member_info();">完善信息</span>
                        </p>
                        <div>
                            <span>
                                <img src="{$level_info.logo}" alt="" class="pc-zuanshi-img" >
                                <a href="{:url('User/quanyi')}">
                                    {$level_info.title}
                                </a>
                                <span>
                                    当前积分：
                                    <a href="{:url('User/my_point_rank')}">{$user.pay_points}</a>
                                </span>
                            </span>
                            <span>
                                <span>
                                    账户余额：
                                    <span>
                                        <a href="{:url('User/user_credit_log')}">
                                            {$user.user_money}
                                        </a>
                                    </span>

                                </span>
                                <a href="{:url('User/recharge')}">充值</a>
                                <a href="{:url('User/user_credit_log')}">账单</a>
                            </span>
                        </div>
                    </div>
                </div>
                <div class="pc-tihuan">
                    <div class="pc-tihuan-headline">
                        <a href="{:url('User/index')}?status=0" {if condition="$status eq 0"} class="pc-dingdan-gaoliang" {/if}>
                            <span class="iconfont icon-qianbao"></span> 待付款
                      </a>
                      <a href="{:url('User/index')}?status=1" {if condition="$status eq 1"} class="pc-dingdan-gaoliang" {/if}>
                            <span class="iconfont icon-daifahuo"></span>待发货
                      </a>
                      <a href="{:url('User/index')}?status=2" {if condition="$status eq 2"} class="pc-dingdan-gaoliang" {/if}>
                            <span class="iconfont icon-biaoqian-fahuo"></span>待收货（{$shouhuo_order}）
                      </a>
                      <a href="{:url('User/index')}?status=4" {if condition="$status eq 4"} class="pc-dingdan-gaoliang" {/if}>
                            <span class="iconfont icon-pingjia"></span>待评价
                      </a>
                    </div>
                  <!-- 订单循环开始 -->
                    {if condition="!empty($list)"}
                    {foreach name="list" item="vo"}
                        <div class="pc-xunhuan">
                        <div>
                            <P>
                                <span>{$vo.addtime|date="Y-m-d H:i",###} | 订单号：
                                    <a href="{:url('User/order_detail')}?id={$vo.id}">{$vo.order_sn}</a>
                                </span>
                                <span>订单金额
                                    <span>{$vo.final_amount}</span>元</span>
                            </P>
                            {foreach name="list_detail" item="v1"}
                                {if condition="$v1.order_id eq $vo.id"}
                                    <div class="pc-goods">
                                        <div>
                                            <img src="{$v1.logo}" alt="">
                                        </div>
                                        <div>
                                            <p>{$v1.name}</p>
                                            <p>{$v1.spec_detail}</p>
                                        </div>
                                        <div>
                                            <p>
                                                <span>￥{$v1.spec_price}</span>
                                                <span>x</span>
                                                <span>{$v1.goods_num}</span>
                                            </p>
                                        </div>
                                    </div>
                                {/if}
                            {/foreach}
                            <div class="pc-caozou">
                                {if condition="$vo.order_status eq 0"}
                                    <a href="{:url('User/create_repay_order')}?id={$vo.id}" class="pc-fukuan">支付订单</a>
                                {elseif condition="$vo.order_status eq 1" /}
                                    <a href="javascript:;" onclick="cancel_order({$vo.id})" class="pc-dingdan">取消订单</a>
                                {elseif condition="($vo.order_status gt 1) AND ($vo.order_status lt 4)" /}
                                    <a href="javascript:;" onclick="confirm_receive_order({$vo.id})" class="pc-dingdan">确认收货</a>
                                {elseif condition="$vo.order_status eq 4" /}
                                    <a href="{:url('User/order_pingjia_list')}?id={$vo.id}" class="pc-dingdan">立即评价</a>
                                {elseif condition="$vo.order_status eq 8"}
                                    <a href="javascript:;" class="pc-dingdan">交易关闭</a>
                                {/if}
                            </div>
                        </div>
                    </div>
                    {/foreach}
                    {/if}

                  <!-- 订单循环结束 -->
                    {if condition="empty($list)"}
                    <div class="pc-kong">
                        <img src="__STATIC__/index/img/my/my.png" alt="">
                        <p>这里什么都没有</p>
                        <p>······</p>
                    </div>
                    {/if}
                </div>
            </div>
        </div>
        <div class="pc-Flip pages" style="text-align: center;">
            {$page}
        </div>
        <!-- 公共脚部  -->
        {include file="public/p_footer" /}
        <!-- 公共脚部 结束 -->
    </div>

</body>

</html>
<script>
    /**
     * 返回上一页
     */
    function go_back(){
        window.history.back();  //返回上一页

    }
    /**
     * 完善会员信息
     */
    function edit_member_info(){
        window.location.href = "{:url('User/my_center')}";
    }
    /**
     * 取消订单
     * @param order_id
     */
    function cancel_order(order_id){
        $.post("{:url('User/cancel_order')}",
            {id:order_id},
            function(data){
                if(data.code == 1){
                    layer.msg('取消成功',{icon:1,time:1500,shade: 0.1}, function(index){
                        layer.close(index);
                        location.reload();
                    });
                    return false;
                }else{
                    layer.msg(data.msg,{icon:2,time:1500,shade: 0.1}, function(index){
                        layer.close(index);
                    });
                    return false;
                }
            }
        );
    }
    /**
     * 确认收货
     * @param order_id
     */
    function confirm_receive_order(order_id){
        $.post("{:url('User/confirm_receive_order')}",
            {id:order_id},
            function(data){
                if(data.code == 1){
                    layer.msg('操作成功',{icon:1,time:1500,shade: 0.1}, function(index){
                        layer.close(index);
                        location.reload();
                    });
                    return false;
                }else{
                    layer.msg(data.msg,{icon:1,time:1500,shade: 0.1}, function(index){
                        layer.close(index);
                        location.reload();
                    });
                    return false;
                }
            }
        )
    }
</script>